home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld Secrets (4th Edition)
/
Mac Secrets CD 4th Ed.toast
/
Apple Advanced Technologies
/
Apple Speech Technologies 1.5
/
PlainTalk Developer Info
/
Speech Recognition Manager SDK
/
SR Sample Code
/
IM SR Example
/
MyHandleSpeechDone.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-10
|
1KB
|
41 lines
#include <SpeechRecognition.h>
#include <AppleEvents.h>
extern void MyProcessRecognitionResult (SRRecognitionResult recResult);
pascal OSErr MyHandleSpeechDone (AppleEvent *theAEevt, AppleEvent *reply, long refcon);
pascal OSErr MyHandleSpeechDone (AppleEvent *theAEevt, AppleEvent *reply,
long refcon)
{
OSErr myErr = noErr;
long actualSize;
DescType actualType;
OSErr recStatus = noErr;
SRRecognitionResult recResult;
SRRecognizer myRec;
/* Get recognition result status and recognizer. */
myErr = AEGetParamPtr (theAEevt, keySRSpeechStatus, typeShortInteger,
&actualType, (Ptr) &recStatus, sizeof (recStatus), &actualSize);
if (!myErr) myErr = recStatus;
if (!myErr) {
myErr = AEGetParamPtr (theAEevt, keySRRecognizer, typeSRRecognizer,
&actualType, (Ptr) &myRec, sizeof (myRec), &actualSize);
if (!myErr) {
myErr = AEGetParamPtr (theAEevt, keySRSpeechResult, typeSRSpeechResult,
&actualType, (Ptr)&recResult, sizeof(recResult), &actualSize);
if (!myErr) {
/* Process the recognition result here. */
MyProcessRecognitionResult (recResult);
/* Release the precessed result */
SRReleaseObject (recResult);
}
}
}
return myErr;
}